package com.ziroom.crm.mq.core.persistence

import com.alibaba.fastjson.JSON
import com.ziroom.crm.mq.core.BaseSpecification

/**
 * <p></p>
 * <p>
 * <PRE>
 * <BR>    修改记录 
 * <BR>-----------------------------------------------
 * <BR>    修改日期         修改人          修改内容
 * </PRE>
 *
 * @author WeiShaoying* @date Created in 2020年09月03日 11:40
 * @version 1.0* @since 1.0
 */
class FilePersistenceTest extends BaseSpecification {

    FilePersistence persistence = new TestMessageFilePersistence();

    def save() {
        TestMessage message = TestMessage.builder().id("1")
                .messageBody("messageBody")
                .testName("testName")
                .build();
        persistence.save(message);

        expect:
        1==1
    }

    def queryNeedSendMessage() {
        List<TestMessage> messageList = persistence.queryMessage(1);
        println JSON.toJSONString(messageList);

        expect:
        messageList.size() == 1
    }
}
